#!/bin/bash

cd $(dirname $0)
pid=$(cat tmp/pids/rainbows.pid)

kill -9 $pid
[ $? = 0 ] && echo "old server process killed! " || echo "there is no alive server process."

bundle exec rainbows -c config/rainbows.conf.rb -E production -D
[ $? = 0 ] && echo "rainbows server started successfully! PID:$(cat tmp/pids/rainbows.pid)"
echo ''
